#ifndef __SCENEOBJECTMANAGER_H__
#define __SCENEOBJECTMANAGER_H__

#include <stl/map.h>
#include <stl/list.h>
#include <standard/reference.h>
#include <standard/xml.h>
#include <math.h>
#include <scene/sceneobjectbase.h>

class CEditorScene;
class CSceneObject;
class CFileWriter;
class CSceneObjectNavigationMap;
class CSceneObjectManager: public CRefObject{
public:
    CSceneObjectManager();
    virtual ~CSceneObjectManager();
    void Init( const char* strResourceSpace, CEditorScene* pEditorScene );
    bool32 Save( CFileWriter *pFileWriter );
    bool32 Open( const char* strResourceSpace, CEditorScene* pEditorScene, CSceneObjectNavigationMap* pSceneObjectNavigationMap, CXML *pXML, HXMLNODEHANDLE hSceneNode );
    CSceneObject* AddSceneObject( uint32 nUUID, const char* strFileName, const char* strName, ESceneObjectType eSceneObjectType, float fInitScale, float fHelperRadius, int32 eCellType, int32 nRotationType, const char* strExtData, Vector3 pPos, Vector3 pRotaion, Vector3 pScaltion, int32 nGridX, int32 nGridY );
    bool32 RemoveSceneObject( uint32 nUUID );
    CSceneObject* GetSceneObject( uint32 nUUID );
    int32 GetSceneObject( float fLeft, float fTop, float fRight, float fBottom, list<CSceneObject*>* pSceneObjectList, ESceneObjectType eSceneObjectType );    
    bool32 IsSelectSceneDecorationList( list<CSceneObject*>* pSceneObjectList, float x, float y );

private:
    uint32 m_nUUID;
    const char* m_strResourceSpace;
    CEditorScene* m_pEditorScene;
    map<uint32, CSceneObject* >m_vSceneObjectList;

};


#endif
